package k8055;

import k8055.JNA_DirectMapped;

public class LectureVitesse extends JNA_DirectMapped
{
	private double tour;
	private float perimetre= (float)0.135; //distance 1 tour rouleau en m
	private double vitesse;
	private static double i=0;
	private static double t=0;
			
	public LectureVitesse() 
	{
		tour = (ReadCounter(2)-i) * 12000 / (ReadCounter(1)-t);				
		vitesse =((tour * perimetre) * (float)3.6);
		System.out.println("Vitesse (km/h) : " +vitesse);
		i = ReadCounter(2);
		t = ReadCounter(1);
	}
	
	public double getVitesse(){	//Accesseur variable vitesse
		return vitesse;
	}
}